//
//  HomePersonalDetailsView.m
//  SameWorld(merchant)
//
//  Created by 李小朋 on 2017/3/29.
//  Copyright © 2017年 杨旭. All rights reserved.
//

#import "HomePersonalDetailsView.h"
@interface HomePersonalDetailsView ()

@end

@implementation HomePersonalDetailsView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setup];
    }
    return self;
}

- (void)setup {
    
    UIView *lineView = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, size_height, 1))];
    lineView.backgroundColor = [UIColor colorWithHexString:@"#cccccc"];
    [self addSubview:lineView];
    
    UIButton *userBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    userBtn.frame = CGRectMake(0, 1, self.frame.size.width /2, 52);
    [userBtn setTitle:@"个人中心" forState:(UIControlStateNormal)];
    [userBtn setTitleColor:color_textOne forState:(UIControlStateNormal)];
    userBtn.titleLabel.font = [UIFont systemFontOfSize:12];
    [userBtn setImage:[UIImage imageNamed:@"gerenzhongxin"] forState:(UIControlStateNormal)];
    userBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -6, 0, 0);
    userBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -6);
    [userBtn addTarget:self action:@selector(userBtnClicked:) forControlEvents:(UIControlEventTouchUpInside)];
    [self addSubview:userBtn];
    
    UIButton *exitBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    exitBtn.frame = CGRectMake(self.frame.size.width /2, 1, self.frame.size.width /2, 52);
    [exitBtn setTitle:@"退出登录" forState:(UIControlStateNormal)];
    [exitBtn setTitleColor:color_textOne forState:(UIControlStateNormal)];
    exitBtn.titleLabel.font = [UIFont systemFontOfSize:12];
    [exitBtn setImage:[UIImage imageNamed:@"tuichu"] forState:(UIControlStateNormal)];
    exitBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -6, 0, 0);
    exitBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -6);
    [exitBtn addTarget:self action:@selector(exitBtnClicked:) forControlEvents:(UIControlEventTouchUpInside)];
    [self addSubview:exitBtn];
    
}

#pragma mark - 个人中心按钮
- (void)userBtnClicked:(UIButton *)sender {
    NSLog(@"个人中心");
    self.userCenterBtnClicked();
}

#pragma mark - 退出按钮
- (void)exitBtnClicked:(UIButton *)sender {
    NSLog(@"退出");
    self.userExitBtnClicked();
}

@end
